﻿using WebApiClientCore;
using WebApiClientCore.Attributes;
using BPM.Web.Shared.Data;
using BPM.Web.Shared.Auth;

namespace BPM.Web.Shared.Service;

[TokenFilter]
public interface INoticeClient : IHttpApi
{
    /// <summary>
    /// 分页查询通知公告
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysNotice/page")]
    ITask<XnRestfulResult<PageResult<SysNotice>>> PageAsync(NoticePageInput body, CancellationToken token = default);

    /// <summary>
    /// 增加通知公告
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysNotice/add")]
    ITask<XnRestfulResult<string>> AddAsync([JsonContent] AddNoticeInput body, CancellationToken token = default);

    /// <summary>
    /// 删除通知公告
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysNotice/delete")]
    ITask<XnRestfulResult<string>> DeleteAsync([JsonContent] DeleteNoticeInput body, CancellationToken token = default);

    /// <summary>
    /// 更新通知公告
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysNotice/edit")]
    ITask<XnRestfulResult<string>> EditAsync([JsonContent] UpdateNoticeInput body, CancellationToken token = default);

    /// <summary>
    /// 获取通知公告详情
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysNotice/detail")]
    ITask<XnRestfulResult<SysNotice>> DetailAsync(QueryNoticeInput body, CancellationToken token = default);

    /// <summary>
    /// 修改通知公告状态
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpPost("sysNotice/changeStatus")]
    ITask<XnRestfulResult<string>> ChangeStatusAsync([JsonContent] ChangeStatusNoticeInput body, CancellationToken token = default);

    /// <summary>
    /// 获取接收的通知公告
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysNotice/received")]
    ITask<XnRestfulResult<PageResult<SysNotice>>> ReceivedAsync(NoticePageInput body, CancellationToken token = default);

    /// <summary>
    /// 未处理消息
    /// </summary>
    /// <param name="body"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    [HttpGet("sysNotice/unread")]
    ITask<XnRestfulResult<PageResult<SysNotice>>> UnreadAsync(NoticeInput body, CancellationToken token = default);
}
